package com.neusoft.pay;


import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {

//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2016102300747894";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCsVX/fLZRn5E4VdtZsLfSbW4SFvocCe/8I11mc7x+4LNLKHwEDRVj3PwYkiCMVAl5r2wrxkz8pUQ/VnqdRoZSBMlrs2nT7ljnmB07VkIJ2Ah7hTxmxcl1tTE/oDe5wC1snfmZr8AYc98V/f9jkKahPTPK+8zZNLXAFPBn7tm9UpPUYJjbzN50mFnmdZfbLl2FyCcMgOdmSOqqOXDvK0+nDw5YDYFoh3VYkPKevK2bFcs2ZZOtqPoDg+CSLifpZM4/UfR5nb78kyd3t+tALLPFDyu6s78rSmkbiXAyNp9Rft1bhrdm8HLB07GmuruTP2tcTyGHskG7JKNARstvdpP9DAgMBAAECggEAICuNxVGy5HoAAY2/lU423VGGOZlJhrMy9qmMtvkEiNMFPmnvPHcTloQTV3p6Yg+hJK0tK896+PGC7TPCtEBfgoat5o0ZTWXLxR8UHlXtpK3cqd6kQzXALwkR2ZXQLuZPy92SrQ+PdJTkL1rkWCNWogcRQYgRWPLkeHWxvAVgXwJkO98FVy7ZVbYpZhX0zLq3GOjbfEfTg2UYTlNj9lAJ2gDx+I3/fBb9nZ9hHV9edFiIRPJf4h/EX9+6qQ7K4qntKLDfRYayeASIaVW/QbQOzlSke+2Sxg6M9RPhvGgravm65J5EgsNtrsLlGNs+/35gqQJJaGwIfzI5MLv3060YgQKBgQD/SMcJF0gsEj5PbcCNfy0DES9ufyhnKevVPQNRXHvHksdMfiNqShBt+KW260CgpFvwPJBwx8pBqrrZ0/5d38fgeuuPyIhQxE/BzlxoIVpQvExNkm9W5jVf62N+QPMqLRl2/BE3zXKxH0JVobniiuBYp1FrFxuYqfzWpx/n7+UdoQKBgQCs0S/c1QaobyGMJzSwbh2I3VFC/Hv2AIF6jlR5Oz6ko4OMfeoyjQua8XA2mSK7VnhSY0Lye/V4mLYv39ErB1xfEUq/KLf5A0vwj1CNLAC8Wg5z5JjWR681Jj6YwZiro3a0iE14L4iiFmqCoANIb/jbw2kPoumfRZNWTfdBxzpKYwKBgGxtwPw/g0wUw5qBB1QSPFAdMIRCRirrR1ve+lXIblqqITSALxKqOqg7AEfdTCnvJY24a7E7atDRb2OuA1BkCEV0cDE1/5AukaHDwMQJxo6cK9yW4euLBAiltjCd7apwVWyQS8/j118b49TzSDzMt9Vv28kcm4AQU2/otEiTQEGBAoGAQJQjGJiaVlLA7IiyDcP4UW6ysR98ix8BQ3TwaCUVcZyQye07mQxP6+SRFDYBXpQffloNaGOeBSS74AP5O+USRYxGrExhAzKSLCDB7x8kXz4f7HreCiTbejcCaT7e+DSrZScSG/lXS4qo3otA7s645haNqgQs3RG4zyVvYis6wxUCgYEAkHV/DAVkTk7ZsM6clNsKNY509PtN6s41qNc3tQhUFZKdESz2N2k7FYjwHzolsQZQhTASX50SCaBgnG3muScwgVvHrDSAidS1O2jgdGVIwzPjLPvAbIEX8iWovF1NmHjXX5mr6w5lYARL+xpmIj45TFeYivOK5Tj703zviZebl/Q=";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArFV/3y2UZ+ROFXbWbC30m1uEhb6HAnv/CNdZnO8fuCzSyh8BA0VY9z8GJIgjFQJea9sK8ZM/KVEP1Z6nUaGUgTJa7Np0+5Y55gdO1ZCCdgIe4U8ZsXJdbUxP6A3ucAtbJ35ma/AGHPfFf3/Y5CmoT0zyvvM2TS1wBTwZ+7ZvVKT1GCY28zedJhZ5nWX2y5dhcgnDIDnZkjqqjlw7ytPpw8OWA2BaId1WJDynrytmxXLNmWTraj6A4Pgki4n6WTOP1H0eZ2+/JMnd7frQCyzxQ8rurO/K0ppG4lwMjafUX7dW4a3ZvBywdOxprq7kz9rXE8hh7JBuySjQEbLb3aT/QwIDAQAB";
    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://v836fk.natappfree.cc/test1/itemOrder/notify";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://v836fk.natappfree.cc/test1/itemOrder/my";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     *
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis() + ".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

